package com.eques.demo.adapter.viewhoder

import android.content.Context
import android.view.View
import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.eques.bean.AnimalAlarmInfo
import com.eques.demo.R
import com.eques.demo.adapter.AlarmAdapter
import com.eques.icvss.utils.ELog

@Suppress("DEPRECATION")
class AlarmHoder(itemView: View?) : RecyclerView.ViewHolder(itemView!!) {

    private val tv_day: TextView = itemView!!.findViewById(R.id.tv_day)
    private val rec_msg_data: RecyclerView = itemView!!.findViewById(R.id.rec_msg_data)

    fun setData(context: Context, animalAlarmInfos: List<AnimalAlarmInfo>, position:Int) {
        ELog.d("data_base_data...",animalAlarmInfos[position].day)
        tv_day.text= animalAlarmInfos[position].day
        var linearLayoutManager=LinearLayoutManager(context)
        linearLayoutManager.orientation=LinearLayoutManager.VERTICAL
        rec_msg_data.layoutManager =linearLayoutManager
        rec_msg_data.adapter = AlarmAdapter(context,animalAlarmInfos[position].tabE1ProAlarmMsgInfo)
    }
}